Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: query params are not getting parsed from curl #3931

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sanish-bruno
Copy link
Collaborator

@sanish-bruno sanish-bruno commented Feb 4, 2025

Description

previously we were passing the url without params while creating a request from curl, the grapgql/http detection still uses urls without params, but when creating a request from the curl, we will pass the raw url with params. in that way the params are not omitted while creation.

Additionally worked on multiline parameters, where encoded params where decoded and stored in the bru file resulting in invalid bru file, and it never gets loaded. now the encoded params, are stored as it is to avoid corruption on bru file

fixes #3924
fixes #3161

parse params

Screen.Recording.2025-02-04.at.1.26.14.PM.mov

multiline

Screen.Recording.2025-02-06.at.11.38.04.AM.mov

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

@sanish-bruno sanish-bruno requested review from ramki-bruno, naman-bruno and Pragadesh-45 and removed request for naman-bruno February 4, 2025 08:02
@pull-request-size pull-request-size bot added size/M and removed size/S labels Feb 5, 2025
@sanish-bruno sanish-bruno requested review from Pragadesh44-Bruno and removed request for Pragadesh-45 February 6, 2025 06:03
return query
.split('#')[0]
.split('&')
.map((param) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire thing can be simplified by:

.map((param) => {
    const [name, value = ''] = param.split('=');

    return { name, value };
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parsing of query parameters from curl
2 participants